const path = require('path');
const __dirnameNew = path.dirname(__filename);

module.exports = {
    entry: './bin/www',
    target: 'node',
    mode: 'development',
    output: {
      path: path.resolve(__dirnameNew, 'dist'),
      filename: 'bundle.js',
    },
    module: {
      rules: [
        { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader' },
        { test: /\.pug$/, loader: 'pug-loader' } // 添加这一行
      ],
    },
    devServer: {
      contentBase: './dist',
      hot: true,
    },
    resolve: {
      extensions: ['.js', '.jsx'],
    },
  };